package datei;

import javax.swing.JOptionPane;
import javax.swing.JFrame;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.util.List;
import Fachlogik.ExceptionWebShop;
import GUI.Fenster;

public class ShopDateiMenuAdapter extends DateiMenuAdapter
{

	
	
		private Fenster fenster;

		public ShopDateiMenuAdapter(Fenster fenster, IdateiAnbindung anbindung)
		{
			super(fenster, anbindung);
			this.fenster = fenster;
		}

		@Override
		protected boolean neu()
		{
			boolean rc = super.neu();
			try
			{
				fenster.updateList();
			} catch (ExceptionWebShop e)
			{
				e.printStackTrace();
				JOptionPane.showMessageDialog(fenster, e.getMessage());
			}
			return rc;
		}

		@Override
		protected boolean oeffnen()
		{
			boolean rc = super.oeffnen();
			try
			{
				fenster.updateList();
			} catch (ExceptionWebShop e)
			{
				e.printStackTrace();
				JOptionPane.showMessageDialog(fenster, e.getMessage());
			}
			return rc;		
		}

	}


